var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var ResKeeper = require("AA_ResKeeper");
var UpLevel5LineTip = require("AA_UpLevel5LineTip");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;
_decorator.inspector;
var _def_LineTipControl = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.lineItem = null;
    t.lineNodeMap = new Map();
    t.hideLineArray = [];
    t.tipidArray = [];
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.ShowOneLine = function (e, t, o, n) {
    if (-1 != this.tipidArray.indexOf(o) || -1 != this.tipidArray.indexOf(n)) {
      return false;
    }
    var i;
    this.tipidArray.push(o);
    this.tipidArray.push(n);
    if (this.hideLineArray.length > 0) {
      i = this.hideLineArray.shift();
    } else {
      var a = cc.instantiate(this.lineItem);
      a.parent = this.node;
      i = a.getComponent(UpLevel5LineTip.default);
    }
    this.lineNodeMap.set(i.node.uuid, i);
    i.StartSet(e, t, this.TakeBackNode.bind(this));
    return true;
  };
  _creator.prototype.TakeBackNode = function (e) {
    if (this.lineNodeMap.has(e.uuid)) {
      this.lineNodeMap.delete(e.uuid);
      e.active = false;
    }
  };
  _creator.prototype.ResetMap = function () {
    this.lineNodeMap.forEach(function (e) {
      e.ResetThis();
    });
  };
  _creator.prototype.HideOne = function (e) {
    var t;
    var o = this;
    this.lineNodeMap.forEach(function (n) {
      if (!(t || n.nodeA != e && n.nodeB != e)) {
        t = n;
        o.TakeBackNode(n.node);
      }
    });
  };
  __decorate([_property(cc.Node)], _creator.prototype, "lineItem", undefined);
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_LineTipControl;